# Maintainer: Guillaume ALAUX <guillaume@archlinux.org>
pkgname=antlr4
_shortname=${pkgname:0:-1}
pkgver=4.6
pkgrel=1
pkgdesc='Parser generator for reading, processing, executing, or translating structured text or binary files'
arch=('any')
url='http://www.antlr.org/index.html'
license=('BSD')
depends=('java-environment>=6')
provides=("antlr=${pkgver}")
source=(http://www.antlr.org/download/${_shortname}-${pkgver}-complete.jar
        https://raw.githubusercontent.com/${_shortname}/${pkgname}/master/LICENSE.txt
        bin_antlr4
        bin_grun)
noextract=("${_shortname}-${pkgver}-complete.jar")
sha256sums=('bd74482f0ee68001926863d4239d23b70719141db522343d39defc4f2cf25969'
            '0c76c37cb13f5bc59c40f4806274069b2404386854fcb4472ae1ee1a562b6ed8'
            '345697e77b7191e2afe70b223f205a8a7fd18a655e6865f503a764583d9a3dcc'
            '81e1536e011762287a095e969784a9f2fbbcc62374ab5fb83e19e01ade20b454')

package() {
  cd "${srcdir}"
  install -D ${_shortname}-${pkgver}-complete.jar \
             "${pkgdir}"/usr/share/java/${_shortname}-${pkgver}-complete.jar
  ln -s antlr-${pkgver}-complete.jar "${pkgdir}"/usr/share/java/antlr-complete.jar
  install -D bin_antlr4 "${pkgdir}"/usr/bin/antlr4
  install -D bin_grun   "${pkgdir}"/usr/bin/grun
  install -D LICENSE.txt "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE.txt
}
